/*
 * @Author: your name
 * @Date: 2022-01-25 17:21:57
 * @LastEditTime: 2022-01-25 17:54:19
 * @LastEditors: LAPTOP-L472H14P
 * @Description: In User Settings Edit
 * @FilePath: \react_front_engineer\src\NodeJs\express\08.mysql链接.js
 */
const mysql = require('mysql')
const db = mysql.createConnection({
  host: 'localhost',
  port: 3306,
  user: 'root',
  password: '123456',
  database: 'test111',
})
db.connect(()=>{
    console.log("链接成功");
})
db.query("SELECT * FROM userinfo",(err, result)=>{
    console.log(err);
    console.log(result);
})